Skip to content

로그 위생 정리 및 레이어별 로깅 규칙 적용#253

Open
ckdals4600 wants to merge 1 commit into
mainfrom
feature/#252-apply-logging-rule
Open

로그 위생 정리 및 레이어별 로깅 규칙 적용#253
ckdals4600 wants to merge 1 commit into
mainfrom
feature/#252-apply-logging-rule

Conversation

@ckdals4600

Copy link
Copy Markdown
Contributor

관련 이슈

PR 설명

운영 로그에 섞여 있던 민감정보와 정상 흐름 노이즈를 제거하고,
레이어·상황별 로그 레벨을 일관된 규칙으로 정리했습니다.
전 도메인(chat/link/infra/auth/member)의 로깅을 점검했습니다.

로그 카테고리/상관관계(MDC, #242)와 비동기 안정화(#241)는 별도 범위입니다.
#239(관측성)가 처리하는 AI 클라이언트·워커·이벤트리스너는 머지 충돌 방지를 위해 제외했습니다.

적용한 로깅 규칙

  • ERROR: 시스템 장애(5xx), 예상치 못한 예외. 스택트레이스 포함.
  • WARN: 클라이언트 오류(4xx), graceful fallback, 비정상이나 치명적이지 않은 분기. 스택트레이스 미포함.
  • INFO: 앱 생애주기, 감사 성격 상태 변화로 최소화.
  • DEBUG: 정상 흐름 추적, 요청/응답 본문, 처리 단계.
  • 공통: 민감정보(이메일·토큰·비밀번호·사용자 콘텐츠)는 운영 기본 레벨에 남기지 않는다. 예외 로깅은 GlobalExceptionHandler에서 일괄 처리(이중 로깅 금지).

변경 사항

민감정보 제거 (우선순위 높음)

  • SummaryStatusEventListener: 웹소켓 푸시 로그에서 이메일(PII) 제거, INFO → DEBUG
  • LinkService: 링크 생성 로그에서 url(사용자 콘텐츠) 제거

로그 레벨 정리

  • LinkService: update/title/memo 로그 INFO → DEBUG (생성/삭제만 감사 성격으로 유지)
  • SummaryQueue: 큐 적재 로그 INFO → DEBUG
  • S3ImageUploader: 캐시 히트 INFO → DEBUG, S3 업로드 실패 ERROR → WARN(fallback)
  • OgTagCrawler: 크롤링 실패 WARN에서 스택트레이스 제거
  • JwtTokenProvider: 토큰 부재(비로그인 정상 흐름) WARN → DEBUG

예외 로깅 정리

  • ChatFacade: 비동기 답변 시작 예외를 4xx(WARN)/5xx(ERROR)로 구분, 메시지+스택트레이스 중복 전달 제거
  • OAuth2FailureHandler: 공급자 서버 오류(5xx)만 WARN 추가 (사용자 취소 등 4xx는 미기록)

불필요한 로깅 제거

  • MockAnswerClient: 테스트용 목의 사용자 질문 로깅 제거 (@slf4j 함께 제거)

@ckdals4600 ckdals4600 linked an issue Jun 24, 2026 that may be closed by this pull request
@ckdals4600 ckdals4600 requested review from Goder-0 and minibr and removed request for minibr June 24, 2026 15:52
@ckdals4600 ckdals4600 self-assigned this Jun 24, 2026
@ckdals4600 ckdals4600 requested a review from minibr June 24, 2026 15:53
@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown

📊 코드 커버리지 리포트

Overall Project 93.14% -0.15% 🍏
Files changed 89.61% 🍏

File Coverage
SummaryStatusEventListener.java 100% 🍏
MockAnswerClient.java 100% 🍏
SummaryQueue.java 100% 🍏
LinkService.java 100% 🍏
JwtErrorCode.java 100% 🍏
JwtTokenProvider.java 92.22% 🍏
S3ImageUploader.java 91.19% 🍏
ChatFacade.java 89.94% -5.03% 🍏


if (ex != null) {
log.error("AI 답변 생성 중 오류 발생 - chatId: {}, error: {}", effectiveChatId, ex.getMessage(), ex);
log.error("AI 답변 생성 중 오류 발생 - chatId={}", chatId, ex);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR 본문에는 ChatFacade의 비동기 답변 시작 예외를 4xx/WARN, 5xx/ERROR로 정리했다고 적혀 있는데, 현재 whenComplete 경로는 여전히 예외를 전부 ERROR로 남기고 있습니다.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수정했습니다

@ckdals4600 ckdals4600 force-pushed the feature/#252-apply-logging-rule branch from e9cfe28 to 31d2c34 Compare June 28, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

로그 위생 정리 및 레이어별 로깅 규칙 수립

2 participants